const data = [1, 2, 3, 1, 4, 5]

const progaram = (data) => {
    let temp = []
    data.forEach(el => {
        if (!temp.includes(el)) {
            temp.push(el)
        }
    });


    return temp
}

const res = progaram(data)

console.log(res)